import {Loading} from 'element-ui';
let loadingInstance
export function startLoading() {
  let options = {
    lock: true,
    text: '努力加载中...',
    spinner: 'el-icon-loading',
    background: 'rgba(0, 0, 0, 0.7)'
  }
  /* 创建loading */
  loadingInstance = Loading.service(options);
}

export function endLoading() {
  /* 结束loading */
  setTimeout(() => {
    if (loadingInstance) {
      loadingInstance.close();
      loadingInstance = null;
    }
  }, 200)
}
